home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 92 / CDMM92_1.ISO / SOF 2 SDK / sof2sdk-101.msi / _92D6AC311BB48EBA344BBABC89DA6AB0 / _D88B8929F5C2466B9EFEAE15CE1BE5EA < prev    next >
Encoding:
Text File  |  2002-07-01  |  15.5 KB  |  511 lines

  1. // Copyright (C) 2001-2002 Raven Software.
  2. //
  3. // g_public.h -- game module information visible to server
  4.  
  5. #define    GAME_API_VERSION    8
  6.  
  7. // entity->svFlags
  8. // the server does not know how to interpret most of the values
  9. // in entityStates (level eType), so the game must explicitly flag
  10. // special server behaviors
  11. #define    SVF_NOCLIENT            0x00000001    // don't send entity to clients, even if it has effects
  12. #define SVF_BOT                    0x00000008    // set if the entity is a bot
  13. #define    SVF_BROADCAST            0x00000020    // send to all connected clients
  14. #define    SVF_PORTAL                0x00000040    // merge a second pvs at origin2 into snapshots
  15. #define    SVF_USE_CURRENT_ORIGIN    0x00000080    // entity->r.currentOrigin instead of entity->s.origin
  16.                                             // for link position (missiles and movers)
  17. #define SVF_SINGLECLIENT        0x00000100    // only send to a single client (entityShared_t->singleClient)
  18. #define SVF_NOSERVERINFO        0x00000200    // don't send CS_SERVERINFO updates to this client
  19.                                             // so that it can be updated for ping tools without
  20.                                             // lagging clients
  21. #define SVF_CAPSULE                0x00000400    // use capsule for collision detection instead of bbox
  22. #define SVF_NOTSINGLECLIENT        0x00000800    // send entity to everyone but one client
  23.                                             // (entityShared_t->singleClient)
  24.  
  25. #define SVF_GLASS_BRUSH            0x08000000    // Ent is a glass brush
  26.  
  27. #define SVF_DOUBLED_BBOX        0x00001000    // Bounding box has been doubled
  28.  
  29. //===============================================================
  30.  
  31.  
  32. typedef struct {
  33.     qboolean    linked;                // qfalse if not in any good cluster
  34.     int            linkcount;
  35.  
  36.     int            svFlags;            // SVF_NOCLIENT, SVF_BROADCAST, etc
  37.     int            singleClient;        // only send to this client when SVF_SINGLECLIENT is set
  38.  
  39.     qboolean    bmodel;                // if false, assume an explicit mins / maxs bounding box
  40.                                     // only set by trap_SetBrushModel
  41.     vec3_t        mins, maxs;
  42.     int            contents;            // CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
  43.                                     // a non-solid entity should set to 0
  44.  
  45.     vec3_t        absmin, absmax;        // derived from mins/maxs and origin + rotation
  46.  
  47.     // currentOrigin will be used for all collision detection and world linking.
  48.     // it will not necessarily be the same as the trajectory evaluation for the current
  49.     // time, because each entity must be moved one at a time after time is advanced
  50.     // to avoid simultanious collision issues
  51.     vec3_t        currentOrigin;
  52.     vec3_t        currentAngles;
  53.  
  54.     // when a trace call is made and passEntityNum != ENTITYNUM_NONE,
  55.     // an ent will be excluded from testing if:
  56.     // ent->s.number == passEntityNum    (don't interact with self)
  57.     // ent->s.ownerNum = passEntityNum    (don't interact with your own missiles)
  58.     // entity[ent->s.ownerNum].ownerNum = passEntityNum    (don't interact with other missiles from owner)
  59.     int            ownerNum;
  60.  
  61.     // mask of clients that this entity should be broadcast too.  The first 32 clients
  62.     // are represented by the first array index and the latter 32 clients are represented
  63.     // by the second array index.
  64.     int            broadcastClients[2];
  65.  
  66. } entityShared_t;
  67.  
  68.  
  69.  
  70. // the server looks at a sharedEntity, which is the start of the game's gentity_t structure
  71. typedef struct {
  72.     entityState_t    s;                // communicated by server to clients
  73.     entityShared_t    r;                // shared by both the server system and game
  74. } sharedEntity_t;
  75.  
  76.  
  77.  
  78. //===============================================================
  79.  
  80. //
  81. // system traps provided by the main engine
  82. //
  83. typedef enum {
  84.     //============== general Quake services ==================
  85.  
  86.     G_PRINT,        // ( const char *string );
  87.     // print message on the local console
  88.  
  89.     G_ERROR,        // ( const char *string );
  90.     // abort the game
  91.  
  92.     G_MILLISECONDS,    // ( void );
  93.     // get current time for profiling reasons
  94.     // this should NOT be used for any game related tasks,
  95.     // because it is not journaled
  96.  
  97.     // console variable interaction
  98.     G_CVAR_REGISTER,    // ( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags );
  99.     G_CVAR_UPDATE,    // ( vmCvar_t *vmCvar );
  100.     G_CVAR_SET,        // ( const char *var_name, const char *value );
  101.     G_CVAR_VARIABLE_INTEGER_VALUE,    // ( const char *var_name );
  102.  
  103.     G_CVAR_VARIABLE_STRING_BUFFER,    // ( const char *var_name, char *buffer, int bufsize );
  104.  
  105.     G_ARGC,            // ( void );
  106.     // ClientCommand and ServerCommand parameter access
  107.  
  108.     G_ARGV,            // ( int n, char *buffer, int bufferLength );
  109.  
  110.     G_FS_FOPEN_FILE,    // ( const char *qpath, fileHandle_t *file, fsMode_t mode );
  111.     G_FS_READ,        // ( void *buffer, int len, fileHandle_t f );
  112.     G_FS_WRITE,        // ( const void *buffer, int len, fileHandle_t f );
  113.     G_FS_FCLOSE_FILE,        // ( fileHandle_t f );
  114.  
  115.     G_SEND_CONSOLE_COMMAND,    // ( const char *text );
  116.     // add commands to the console as if they were typed in
  117.     // for map changing, etc
  118.  
  119.  
  120.     //=========== server specific functionality =============
  121.  
  122.     G_LOCATE_GAME_DATA,        // ( gentity_t *gEnts, int numGEntities, int sizeofGEntity_t,
  123.     //                            playerState_t *clients, int sizeofGameClient );
  124.     // the game needs to let the server system know where and how big the gentities
  125.     // are, so it can look at them directly without going through an interface
  126.  
  127.     G_GET_WORLD_BOUNDS,        // ( vec3_t mins, vec3_t maxs )
  128.                             // Returns the mins and maxs of the world
  129.  
  130.     G_RMG_INIT,
  131.  
  132.     G_DROP_CLIENT,        // ( int clientNum, const char *reason );
  133.     // kick a client off the server with a message
  134.  
  135.     G_SEND_SERVER_COMMAND,    // ( int clientNum, const char *fmt, ... );
  136.     // reliably sends a command string to be interpreted by the given
  137.     // client.  If clientNum is -1, it will be sent to all clients
  138.  
  139.     G_SET_CONFIGSTRING,    // ( int num, const char *string );
  140.     // config strings hold all the index strings, and various other information
  141.     // that is reliably communicated to all clients
  142.     // All of the current configstrings are sent to clients when
  143.     // they connect, and changes are sent to all connected clients.
  144.     // All confgstrings are cleared at each level start.
  145.  
  146.     G_GET_CONFIGSTRING,    // ( int num, char *buffer, int bufferSize );
  147.  
  148.     G_GET_USERINFO,        // ( int num, char *buffer, int bufferSize );
  149.     // userinfo strings are maintained by the server system, so they
  150.     // are persistant across level loads, while all other game visible
  151.     // data is completely reset
  152.  
  153.     G_SET_USERINFO,        // ( int num, const char *buffer );
  154.  
  155.     G_GET_SERVERINFO,    // ( char *buffer, int bufferSize );
  156.     // the serverinfo info string has all the cvars visible to server browsers
  157.  
  158.     G_SET_BRUSH_MODEL,    // ( gentity_t *ent, const char *name );
  159.     // sets mins and maxs based on the brushmodel name
  160.  
  161.     G_SET_ACTIVE_SUBBSP,    // int index
  162.  
  163.     G_TRACE,    // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
  164.     // collision detection against all linked entities
  165.  
  166.     G_POINT_CONTENTS,    // ( const vec3_t point, int passEntityNum );
  167.     // point contents against all linked entities
  168.  
  169.     G_IN_PVS,            // ( const vec3_t p1, const vec3_t p2 );
  170.  
  171.     G_IN_PVS_IGNORE_PORTALS,    // ( const vec3_t p1, const vec3_t p2 );
  172.  
  173.     G_ADJUST_AREA_PORTAL_STATE,    // ( gentity_t *ent, qboolean open );
  174.  
  175.     G_AREAS_CONNECTED,    // ( int area1, int area2 );
  176.  
  177.     G_LINKENTITY,        // ( gentity_t *ent );
  178.     // an entity will never be sent to a client or used for collision
  179.     // if it is not passed to linkentity.  If the size, position, or
  180.     // solidity changes, it must be relinked.
  181.  
  182.     G_UNLINKENTITY,        // ( gentity_t *ent );        
  183.     // call before removing an interactive entity
  184.  
  185.     G_ENTITIES_IN_BOX,    // ( const vec3_t mins, const vec3_t maxs, gentity_t **list, int maxcount );
  186.     // EntitiesInBox will return brush models based on their bounding box,
  187.     // so exact determination must still be done with EntityContact
  188.  
  189.     G_ENTITY_CONTACT,    // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
  190.     // perform an exact check against inline brush models of non-square shape
  191.  
  192.     // access for bots to get and free a server client (FIXME?)
  193.     G_BOT_ALLOCATE_CLIENT,    // ( void );
  194.  
  195.     G_BOT_FREE_CLIENT,    // ( int clientNum );
  196.  
  197.     G_GET_USERCMD,    // ( int clientNum, usercmd_t *cmd )
  198.  
  199.     G_GET_ENTITY_TOKEN,    // qboolean ( char *buffer, int bufferSize )
  200.     // Retrieves the next string token from the entity spawn text, returning
  201.     // false when all tokens have been parsed.
  202.     // This should only be done at GAME_INIT time.
  203.  
  204.     G_FS_GETFILELIST,
  205.     G_BOT_GET_MEMORY,
  206.     G_BOT_FREE_MEMORY,
  207.     G_DEBUG_POLYGON_CREATE,
  208.     G_DEBUG_POLYGON_DELETE,
  209.     G_REAL_TIME,
  210.     G_SNAPVECTOR,
  211.  
  212.     G_TRACECAPSULE,    // ( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentmask );
  213.     G_ENTITY_CONTACTCAPSULE,    // ( const vec3_t mins, const vec3_t maxs, const gentity_t *ent );
  214.  
  215.     G_MEMSET = 100,
  216.     G_MEMCPY,
  217.     G_STRNCPY,
  218.     G_SIN,
  219.     G_COS,
  220.     G_ATAN2,
  221.     G_SQRT,
  222.     G_ANGLEVECTORS,
  223.     G_PERPENDICULARVECTOR,
  224.     G_FLOOR,
  225.     G_CEIL,
  226.  
  227.     G_TESTPRINTINT,
  228.     G_TESTPRINTFLOAT,
  229.  
  230.     G_ACOS,
  231.     G_ASIN,
  232.  
  233.     G_MATRIXMULTIPLY,
  234.  
  235.     BOTLIB_SETUP = 200,                // ( void );
  236.     BOTLIB_SHUTDOWN,                // ( void );
  237.     BOTLIB_LIBVAR_SET,
  238.     BOTLIB_LIBVAR_GET,
  239.     BOTLIB_PC_ADD_GLOBAL_DEFINE,
  240.     BOTLIB_START_FRAME,
  241.     BOTLIB_LOAD_MAP,
  242.     BOTLIB_UPDATENTITY,
  243.     BOTLIB_TEST,
  244.  
  245.     BOTLIB_GET_SNAPSHOT_ENTITY,        // ( int client, int ent );
  246.     BOTLIB_GET_CONSOLE_MESSAGE,        // ( int client, char *message, int size );
  247.     BOTLIB_USER_COMMAND,            // ( int client, usercmd_t *ucmd );
  248.  
  249.     BOTLIB_AAS_ENABLE_ROUTING_AREA = 300,
  250.     BOTLIB_AAS_BBOX_AREAS,
  251.     BOTLIB_AAS_AREA_INFO,
  252.     BOTLIB_AAS_ENTITY_INFO,
  253.  
  254.     BOTLIB_AAS_INITIALIZED,
  255.     BOTLIB_AAS_PRESENCE_TYPE_BOUNDING_BOX,
  256.     BOTLIB_AAS_TIME,
  257.  
  258.     BOTLIB_AAS_POINT_AREA_NUM,
  259.     BOTLIB_AAS_TRACE_AREAS,
  260.  
  261.     BOTLIB_AAS_POINT_CONTENTS,
  262.     BOTLIB_AAS_NEXT_BSP_ENTITY,
  263.     BOTLIB_AAS_VALUE_FOR_BSP_EPAIR_KEY,
  264.     BOTLIB_AAS_VECTOR_FOR_BSP_EPAIR_KEY,
  265.     BOTLIB_AAS_FLOAT_FOR_BSP_EPAIR_KEY,
  266.     BOTLIB_AAS_INT_FOR_BSP_EPAIR_KEY,
  267.  
  268.     BOTLIB_AAS_AREA_REACHABILITY,
  269.  
  270.     BOTLIB_AAS_AREA_TRAVEL_TIME_TO_GOAL_AREA,
  271.  
  272.     BOTLIB_AAS_SWIMMING,
  273.     BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT,
  274.  
  275.     BOTLIB_EA_SAY = 400,
  276.     BOTLIB_EA_SAY_TEAM,
  277.     BOTLIB_EA_COMMAND,
  278.  
  279.     BOTLIB_EA_ACTION,
  280.     BOTLIB_EA_GESTURE,
  281.     BOTLIB_EA_TALK,
  282.     BOTLIB_EA_ATTACK,
  283.     BOTLIB_EA_ALT_ATTACK,
  284.     BOTLIB_EA_FORCEPOWER,
  285.     BOTLIB_EA_USE,
  286.     BOTLIB_EA_RESPAWN,
  287.     BOTLIB_EA_CROUCH,
  288.     BOTLIB_EA_MOVE_UP,
  289.     BOTLIB_EA_MOVE_DOWN,
  290.     BOTLIB_EA_MOVE_FORWARD,
  291.     BOTLIB_EA_MOVE_BACK,
  292.     BOTLIB_EA_MOVE_LEFT,
  293.     BOTLIB_EA_MOVE_RIGHT,
  294.  
  295.     BOTLIB_EA_SELECT_WEAPON,
  296.     BOTLIB_EA_JUMP,
  297.     BOTLIB_EA_DELAYED_JUMP,
  298.     BOTLIB_EA_MOVE,
  299.     BOTLIB_EA_VIEW,
  300.  
  301.     BOTLIB_EA_END_REGULAR,
  302.     BOTLIB_EA_GET_INPUT,
  303.     BOTLIB_EA_RESET_INPUT,
  304.  
  305.  
  306.     BOTLIB_AI_LOAD_CHARACTER = 500,
  307.     BOTLIB_AI_FREE_CHARACTER,
  308.     BOTLIB_AI_CHARACTERISTIC_FLOAT,
  309.     BOTLIB_AI_CHARACTERISTIC_BFLOAT,
  310.     BOTLIB_AI_CHARACTERISTIC_INTEGER,
  311.     BOTLIB_AI_CHARACTERISTIC_BINTEGER,
  312.     BOTLIB_AI_CHARACTERISTIC_STRING,
  313.  
  314.     BOTLIB_AI_ALLOC_CHAT_STATE,
  315.     BOTLIB_AI_FREE_CHAT_STATE,
  316.     BOTLIB_AI_QUEUE_CONSOLE_MESSAGE,
  317.     BOTLIB_AI_REMOVE_CONSOLE_MESSAGE,
  318.     BOTLIB_AI_NEXT_CONSOLE_MESSAGE,
  319.     BOTLIB_AI_NUM_CONSOLE_MESSAGE,
  320.     BOTLIB_AI_INITIAL_CHAT,
  321.     BOTLIB_AI_REPLY_CHAT,
  322.     BOTLIB_AI_CHAT_LENGTH,
  323.     BOTLIB_AI_ENTER_CHAT,
  324.     BOTLIB_AI_STRING_CONTAINS,
  325.     BOTLIB_AI_FIND_MATCH,
  326.     BOTLIB_AI_MATCH_VARIABLE,
  327.     BOTLIB_AI_UNIFY_WHITE_SPACES,
  328.     BOTLIB_AI_REPLACE_SYNONYMS,
  329.     BOTLIB_AI_LOAD_CHAT_FILE,
  330.     BOTLIB_AI_SET_CHAT_GENDER,
  331.     BOTLIB_AI_SET_CHAT_NAME,
  332.  
  333.     BOTLIB_AI_RESET_GOAL_STATE,
  334.     BOTLIB_AI_RESET_AVOID_GOALS,
  335.     BOTLIB_AI_PUSH_GOAL,
  336.     BOTLIB_AI_POP_GOAL,
  337.     BOTLIB_AI_EMPTY_GOAL_STACK,
  338.     BOTLIB_AI_DUMP_AVOID_GOALS,
  339.     BOTLIB_AI_DUMP_GOAL_STACK,
  340.     BOTLIB_AI_GOAL_NAME,
  341.     BOTLIB_AI_GET_TOP_GOAL,
  342.     BOTLIB_AI_GET_SECOND_GOAL,
  343.     BOTLIB_AI_CHOOSE_LTG_ITEM,
  344.     BOTLIB_AI_CHOOSE_NBG_ITEM,
  345.     BOTLIB_AI_TOUCHING_GOAL,
  346.     BOTLIB_AI_ITEM_GOAL_IN_VIS_BUT_NOT_VISIBLE,
  347.     BOTLIB_AI_GET_LEVEL_ITEM_GOAL,
  348.     BOTLIB_AI_AVOID_GOAL_TIME,
  349.     BOTLIB_AI_INIT_LEVEL_ITEMS,
  350.     BOTLIB_AI_UPDATE_ENTITY_ITEMS,
  351.     BOTLIB_AI_LOAD_ITEM_WEIGHTS,
  352.     BOTLIB_AI_FREE_ITEM_WEIGHTS,
  353.     BOTLIB_AI_SAVE_GOAL_FUZZY_LOGIC,
  354.     BOTLIB_AI_ALLOC_GOAL_STATE,
  355.     BOTLIB_AI_FREE_GOAL_STATE,
  356.  
  357.     BOTLIB_AI_RESET_MOVE_STATE,
  358.     BOTLIB_AI_MOVE_TO_GOAL,
  359.     BOTLIB_AI_MOVE_IN_DIRECTION,
  360.     BOTLIB_AI_RESET_AVOID_REACH,
  361.     BOTLIB_AI_RESET_LAST_AVOID_REACH,
  362.     BOTLIB_AI_REACHABILITY_AREA,
  363.     BOTLIB_AI_MOVEMENT_VIEW_TARGET,
  364.     BOTLIB_AI_ALLOC_MOVE_STATE,
  365.     BOTLIB_AI_FREE_MOVE_STATE,
  366.     BOTLIB_AI_INIT_MOVE_STATE,
  367.  
  368.     BOTLIB_AI_CHOOSE_BEST_FIGHT_WEAPON,
  369.     BOTLIB_AI_GET_WEAPON_INFO,
  370.     BOTLIB_AI_LOAD_WEAPON_WEIGHTS,
  371.     BOTLIB_AI_ALLOC_WEAPON_STATE,
  372.     BOTLIB_AI_FREE_WEAPON_STATE,
  373.     BOTLIB_AI_RESET_WEAPON_STATE,
  374.  
  375.     BOTLIB_AI_GENETIC_PARENTS_AND_CHILD_SELECTION,
  376.     BOTLIB_AI_INTERBREED_GOAL_FUZZY_LOGIC,
  377.     BOTLIB_AI_MUTATE_GOAL_FUZZY_LOGIC,
  378.     BOTLIB_AI_GET_NEXT_CAMP_SPOT_GOAL,
  379.     BOTLIB_AI_GET_MAP_LOCATION_GOAL,
  380.     BOTLIB_AI_NUM_INITIAL_CHATS,
  381.     BOTLIB_AI_GET_CHAT_MESSAGE,
  382.     BOTLIB_AI_REMOVE_FROM_AVOID_GOALS,
  383.     BOTLIB_AI_PREDICT_VISIBLE_POSITION,
  384.  
  385.     BOTLIB_AI_SET_AVOID_GOAL_TIME,
  386.     BOTLIB_AI_ADD_AVOID_SPOT,
  387.     BOTLIB_AAS_ALTERNATIVE_ROUTE_GOAL,
  388.     BOTLIB_AAS_PREDICT_ROUTE,
  389.     BOTLIB_AAS_POINT_REACHABILITY_AREA_INDEX,
  390.  
  391.     BOTLIB_PC_LOAD_SOURCE,
  392.     BOTLIB_PC_FREE_SOURCE,
  393.     BOTLIB_PC_READ_TOKEN,
  394.     BOTLIB_PC_SOURCE_FILE_AND_LINE,
  395.     BOTLIB_PC_LOAD_GLOBAL_DEFINES,
  396.     BOTLIB_PC_REMOVE_ALL_GLOBAL_DEFINES,
  397.  
  398.     G_G2_LISTBONES,
  399.     G_G2_LISTSURFACES,
  400.     G_G2_HAVEWEGHOULMODELS,
  401.     G_G2_SETMODELS,
  402.     G_G2_GETBOLT,
  403.     G_G2_INITGHOUL2MODEL,
  404.     G_G2_ADDBOLT,
  405.     G_G2_SETBOLTINFO,
  406.     G_G2_ANGLEOVERRIDE,
  407.     G_G2_PLAYANIM,
  408.     G_G2_GETGLANAME,
  409.     G_G2_COPYGHOUL2INSTANCE,
  410.     G_G2_COPYSPECIFICGHOUL2MODEL,
  411.     G_G2_DUPLICATEGHOUL2INSTANCE,
  412.     G_G2_REMOVEGHOUL2MODEL,
  413.     G_G2_CLEANMODELS,
  414.  
  415.     // CGenericParser2 (void *) routines
  416.     G_GP_PARSE,
  417.     G_GP_PARSE_FILE,
  418.     G_GP_CLEAN,
  419.     G_GP_DELETE,
  420.     G_GP_GET_BASE_PARSE_GROUP,
  421.  
  422.     // CGPGroup (void *) routines
  423.     G_GPG_GET_NAME,
  424.     G_GPG_GET_NEXT,
  425.     G_GPG_GET_INORDER_NEXT,
  426.     G_GPG_GET_INORDER_PREVIOUS,
  427.     G_GPG_GET_PAIRS,
  428.     G_GPG_GET_INORDER_PAIRS,
  429.     G_GPG_GET_SUBGROUPS,
  430.     G_GPG_GET_INORDER_SUBGROUPS,
  431.     G_GPG_FIND_SUBGROUP,
  432.     G_GPG_FIND_PAIR,
  433.     G_GPG_FIND_PAIRVALUE,
  434.  
  435.     // CGPValue (void *) routines
  436.     G_GPV_GET_NAME,
  437.     G_GPV_GET_NEXT,
  438.     G_GPV_GET_INORDER_NEXT,
  439.     G_GPV_GET_INORDER_PREVIOUS,
  440.     G_GPV_IS_LIST,
  441.     G_GPV_GET_TOP_VALUE,
  442.     G_GPV_GET_LIST,
  443.  
  444.     G_CM_REGISTER_TERRAIN,
  445.     G_GET_MODEL_FORMALNAME,
  446.  
  447.     G_VM_LOCALALLOC,
  448.     G_VM_LOCALALLOCUNALIGNED,
  449.     G_VM_LOCALTEMPALLOC,
  450.     G_VM_LOCALTEMPFREE,
  451.     G_VM_LOCALSTRINGALLOC,
  452.  
  453.     G_G2_COLLISIONDETECT,
  454.     G_G2_REGISTERSKIN,
  455.     G_G2_SETSKIN,
  456.     G_G2_GETANIMFILENAMEINDEX,
  457.  
  458.     G_GT_INIT,
  459.     G_GT_RUNFRAME,
  460.     G_GT_START,
  461.     G_GT_SENDEVENT,
  462.  
  463. } gameImport_t;
  464.  
  465.  
  466. //
  467. // functions exported by the game subsystem
  468. //
  469. typedef enum {
  470.     GAME_INIT,    // ( int levelTime, int randomSeed, int restart );
  471.     // init and shutdown will be called every single level
  472.     // The game should call G_GET_ENTITY_TOKEN to parse through all the
  473.     // entity configuration text and spawn gentities.
  474.  
  475.     GAME_SHUTDOWN,    // (void);
  476.  
  477.     GAME_CLIENT_CONNECT,    // ( int clientNum, qboolean firstTime, qboolean isBot );
  478.     // return NULL if the client is allowed to connect, otherwise return
  479.     // a text string with the reason for denial
  480.  
  481.     GAME_CLIENT_BEGIN,                // ( int clientNum );
  482.  
  483.     GAME_CLIENT_USERINFO_CHANGED,    // ( int clientNum );
  484.  
  485.     GAME_CLIENT_DISCONNECT,            // ( int clientNum );
  486.  
  487.     GAME_CLIENT_COMMAND,            // ( int clientNum );
  488.  
  489.     GAME_CLIENT_THINK,                // ( int clientNum );
  490.  
  491.     GAME_RUN_FRAME,                    // ( int levelTime );
  492.  
  493.     GAME_GHOUL_INIT,
  494.  
  495.     GAME_GHOUL_SHUTDOWN,
  496.  
  497.     GAME_CONSOLE_COMMAND,            // ( void );
  498.     // ConsoleCommand will be called when a command has been issued
  499.     // that is not recognized as a builtin function.
  500.     // The game can issue trap_argc() / trap_argv() commands to get the command
  501.     // and parameters.  Return qfalse if the game doesn't recognize it as a command.
  502.  
  503.     BOTAI_START_FRAME,                // ( int time );
  504.  
  505.     GAME_SPAWN_RMG_ENTITY,
  506.  
  507.     GAME_GAMETYPE_COMMAND,            // ( int cmd, int arg0, int arg1, int arg2, int arg3, int arg4 );
  508.  
  509. } gameExport_t;
  510.  
  511.